(function Watcher (window) {
	
	Watcher.state = {};
	Watcher.stateID = "Intro";
	Watcher.stateStep = 0;

	window.Watcher = Watcher;

	Watcher.browserValidator = function () {
		var val = false;
		
		if (Modernizr.canvas) {
				val = true;
		}

	
		if (!Modernizr.webgl) {
			alert ("No Webgl Support in this browser. Please update it.\n\nOr install another one.");
		}

		console.log(Modernizr.csstransforms3d + "uses 3D transforms")
		return val;
	}

	Watcher.watch = function () {

		if ( document.location.protocol === 'file:' ) 
			{
					alert('Este website tem de ser visto num servidor!. This website is suposed to be on a webserver!.')
			}
			$(window).bind('hashchange', function(event) 
				{	
					Watcher.state[Watcher.stateID] = Watcher.stateStep;
				//	$.bbq.pushState(Watcher.state);
				//	console.log($.bbq.getState());
				});

			$(window).trigger('hashchange');
	}

})(window);